package it.polimi.TravelDream.ejb.entities;

import it.polimi.TravelDream.ejb.dtos.AddressDTO;

import java.io.Serializable;
import java.lang.String;

import javax.persistence.*;

/**
 * Entity implementation class for Entity: Address
 *
 */
@Entity
@Table(name = "addresses")
@NamedQueries({
@NamedQuery(name = Address.FIND_ALL, query = "Select a FROM Address a"),
@NamedQuery(name = Address.FIND_BY_ID, query = "SELECT a FROM Address a WHERE a.addressID = :addressID")
})
public class Address implements Serializable {

	   
	@Id
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	private int addressID;
	@Column(length=45, nullable=false)
	private String street;
	private int streetNumber;
	@Column(length=45, nullable=false)
	private String city;
	@Column(length=5, nullable=false)
	private String cap;
	@Column(length=4, nullable=false)
	private String district;
	@Column(length=45, nullable=false)
	private String nation;
	
	
	public static final String FIND_ALL = "Address.findAll";
	public static final String FIND_BY_ID = "Address.findById";
	public static final String FIND_CITIES_OF_HOTELS = "Address.findCitiesByHotels";

	private static final long serialVersionUID = 1L;

	public Address() {
	}
	
	public Address(AddressDTO addressDTO) {
		super();
		this.street = addressDTO.getStreet();
		this.streetNumber = addressDTO.getStreetNumber();
		this.city = addressDTO.getCity();
		this.cap = addressDTO.getCap();
		this.district = addressDTO.getDistrict();
		this.nation = addressDTO.getNation();
	}
	
	public int getAddressID() {
		return this.addressID;
	}

	public void setAddressID(int addressID) {
		this.addressID = addressID;
	}   
	public String getStreet() {
		return this.street;
	}

	public void setStreet(String street) {
		this.street = street;
	}   
	public int getStreetNumber() {
		return this.streetNumber;
	}

	public void setStreetNumber(int streetNumber) {
		this.streetNumber = streetNumber;
	}   
	public String getCity() {
		return this.city;
	}

	public void setCity(String city) {
		this.city = city;
	}   
	public String getCap() {
		return this.cap;
	}

	public void setCap(String cap) {
		this.cap = cap;
	}   
	public String getDistrict() {
		return this.district;
	}

	public void addressDTOaddressDTO(String district) {
		this.district = district;
	}   
	public String getNation() {
		return this.nation;
	}

	public void setNation(String nation) {
		this.nation = nation;
	}

	public void setDistrict(String district) {
		this.district = district;
	}
   
}
